package com.tedu.DI;

import com.tedu.Teacher;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Cha {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext spring =
                new ClassPathXmlApplicationContext("spring-config.xml");
            Students s = (Students)spring.getBean("students");
            Teachers t = (Teachers)spring.getBean("teachers");
        System.out.println(s);
        System.out.println(t);
//        Teachers t2 =new Teachers();
//        t2.name="张三";
//        s.setT1(t2);
//        System.out.println(s.getT1());
    }
}
